package it.newinstance.jrainbow.source;


import java.util.Iterator;

/**
 * @author Luigi R. Viggiano
 * @version $Id: AbstractIterator.java 138 2007-06-12 12:23:29Z luigi.viggiano $
 */
abstract class AbstractIterator<E> implements Iterator<E>, Iterable<E> {
    
	protected TaggedChar[] taggedChars;
    protected int position;

    public AbstractIterator(TaggedSource source) {		
		source.accept(this);
	}
    
    public boolean hasNext() {
        return position < taggedChars.length;
    }

    public void remove() {
        throw new UnsupportedOperationException("don't do that!");
    }    
    
    public Iterator<E> iterator() {
    	return this;
    }
}
